package com.lagou.client;

import com.alibaba.fastjson.JSONObject;
import com.lagou.service.RpcRequest;
import com.lagou.service.UserService;

public class ClientBootStrap {

    public static final String providerName = "UserService#sayHello#";
    public static final RpcRequest rpcRequest = new RpcRequest();

    public static void main(String[] args) throws InterruptedException {

        RpcConsumer rpcConsumer = new RpcConsumer();
        UserService proxy = (UserService) rpcConsumer.createProxy(UserService.class, rpcRequest);

        while (true) {
            Thread.sleep(2000);
            //System.out.println(proxy.sayHello("UserService#sayHello#are you ok?"));
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("a", "b");
            String request = proxy.getRequest(jsonObject);
            System.out.println(request);
        }


    }


}
